package 面向对象;

public class StringComparison {
    public static void main(String[] args) {
        String a = new String("zxc");//记录堆地址值
        String b ="zxc";//记录串池地址值
        String c = "ZXC";

        System.out.println(a == b);//false

        boolean reasult= a.equals(b);
        System.out.println(reasult);//true  equals要完全一样

        boolean reasult2 = a.equalsIgnoreCase(c);
        System.out.println(reasult2);//true   equalsIgnoreCase可以忽略大小写

    }
}
